{% extends "../main.html" %}

{% block title %}{{ _("Import XML") }}{% end %}

{% block content %}
<div class="container">
    <h1>
        <i class="fa fa-upload"></i>
        {{ _("Import XML") }}
    </h1>
    <br />
    {% if errors is not None and len(errors) != 0 %}
        {% for error in errors %}
        <div class="alert alert-error">
            <a class="close" data-dismiss="alert" href="#">&times;</a>
            <h4 class="alert-heading">{{ _("ERROR") }}</h4>
            {{ error }}
        </div>
        {% end %}
    {% end %}
    {% if success is not None %}
    <div class="alert alert-success">
        <a class="close" data-dismiss="alert" href="#">&times;</a>
        <h4 class="alert-heading">{{ _("SUCCESS") }}</h4>
        {{ success }}
    </div>
    {% end %}
    <div class="well">
        <form class="form-horizontal" action="/admin/import/xml" method="post" enctype="multipart/form-data">
            {% raw xsrf_form_html() %}
            <div class="control-group">
                <label class="control-label" for="xml_file">{{ _("XML File") }}</label>
                <div class="controls">
                    <input id="xml_file" name="xml_file" type="file">
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <button class="btn btn-primary" type="submit">{{ _("Import File") }}</button>
                </div>
            </div>
        </form>
    </div>
</div>
{% end %}
